home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_vim.idb / usr / freeware / share / vim / doc / windows.txt.z / windows.txt
Encoding:
Text File  |  1998-10-28  |  24.8 KB  |  621 lines

  1. *windows.txt*   For Vim version 5.0.  Last modification: 1998 Jan 25
  2.  
  3.  
  4.           VIM REFERENCE MANUAL    by Bram Moolenaar
  5.  
  6.  
  7. Editing with multiple windows and buffers.        *windows* *buffers*
  8.  
  9. The commands which have been added to use multiple windows and buffers are
  10. explained here.  Additionally, there are explanations for commands that work
  11. differently when used in combination with more than one window.
  12.  
  13. 1.  Introduction            |windows-intro|
  14. 2.  Starting Vim            |windows-starting|
  15. 3.  Opening and closing a window    |opening-window|
  16. 4.  Moving cursor to other windows    |window-move-cursor|
  17. 5.  Moving windows around        |window-moving|
  18. 6.  Window resizing            |window-resize|
  19. 7.  Exiting Vim                |window-exit|
  20. 8.  Writing with multiple buffers    |buffer-write|
  21. 9.  argument and buffer list commands    |buffer-list|
  22. 10. Tag or file name under the cursor    |window-tag|
  23. 11. Using hidden buffers        |buffer-hidden|
  24.  
  25. {Vi does not have any of these commands}
  26.  
  27. ==============================================================================
  28. 1. Introduction                        *windows-intro*
  29.  
  30. A window is a viewport onto a buffer.  You can use multiple windows on one
  31. buffer, or several windows on different buffers.
  32.  
  33. A buffer is a file loaded into memory for editing.  The original file remains
  34. unchanged until you write the buffer to the file.
  35.  
  36. A buffer can be in one of three states:
  37.  
  38.                             *active-buffer*
  39. active:   The buffer is displayed in a window.  If there is a file for this
  40.       buffer, it has been read into the buffer.  The buffer may have been
  41.       modified.
  42.                             *hidden-buffer*
  43. hidden:   The buffer is not displayed.  If there is a file for this buffer, it
  44.           has been read into the buffer.  The buffer may have been modified.
  45.                             *inactive-buffer*
  46. inactive: The buffer is not displayed and does not contain anything.  Options
  47.           for the buffer are remembered if the file was once loaded.
  48.  
  49. In a table:
  50.  
  51. state        displayed    loaded        ":buffers"  ~
  52.         in window            shows        ~
  53. active          yes         yes          ' '
  54. hidden          no         yes          'h'
  55. inactive      no         no          '-'
  56.  
  57. ==============================================================================
  58. 2. Starting Vim                        *windows-starting*
  59.  
  60. By default, Vim starts with one window, just like Vi.
  61.  
  62. The "-o" argument to Vim can be used to open a window for each file in the
  63. argument list: "Vim -o file1 file2 file3" will open three windows.
  64.  
  65. "-oN", where N is a decimal number, opens N windows.  If there are more
  66. file names than windows, only N windows are opened and some files do not get a
  67. window.  If there are more windows than file names, the last few windows will
  68. be editing empty buffers.
  69.  
  70. If there are many file names, the windows will become very small.  You might
  71. want to set the 'winheight' option to create a workable situation.
  72.  
  73. Buf/Win Enter/Leave autocommands are not executed when opening the new windows
  74. and reading the files, that's only done when they are really entered.
  75.  
  76.                             *status-line*
  77. A status line will be used to separate windows.  The 'laststatus' option tells
  78. when the last window also has a status line:
  79.     'laststatus' = 0    never a status line
  80.     'laststatus' = 1    status line if there is more than one window
  81.     'laststatus' = 2    always a status line
  82. Normally, inversion is used to display the status line.  This can be changed
  83. with the 's' character in the 'highlight' option.  For example, "sb" sets it to
  84. bold characters.  If no highlighting is used for the status line ("sn"), the
  85. '=' character is used.  If the mouse is supported and enabled with the 'mouse'
  86. option, a status line can be dragged to resize windows.
  87.  
  88. Note: If you expect your status line to be in reverse video and it isn't,
  89. check if the 'highlight' option contains "si".  In version 3.0, this meant to
  90. invert the status line.  Now it should be "sr", reverse the status line, as
  91. "si" now stands for italic!  If italic is not available on your terminal, the
  92. status line is inverted anyway; you will only see this problem on terminals
  93. that have termcap codes for italics.
  94.  
  95. ==============================================================================
  96. 3. Opening and closing a window                *opening-window*
  97.  
  98. CTRL-W s                        *CTRL-W_s*
  99. CTRL-W S                        *CTRL-W_S*
  100. CTRL-W CTRL-S                        *CTRL-W_CTRL-S*
  101. :[N]sp[lit] [+cmd]                    *:sp* *:split*
  102.         Split current window in two.  The result is two viewports on
  103.         the same file.  Make new window N high (default is to use half
  104.         the height of the current window).  Reduces the current window
  105.         height to create room (and others, if the 'equalalways' option
  106.         is set).  (Note: CTRL-S does not work on all terminals).  Also
  107.         see |+cmd|.
  108.  
  109. CTRL-W n                        *CTRL-W_n*
  110. CTRL-W CTRL_N                        *CTRL-W_CTRL-N*
  111. :[N]new [+cmd]                        *:new*
  112.         Create a new window and start editing an empty file in it.
  113.         Make new window N high (default is to use half the existing
  114.         height).  Reduces the current window height to create room (and
  115.         others, if the 'equalalways' option is set).  Also see
  116.         |+cmd|.  If 'fileformats' is not empty, the first format given
  117.         will be used for the new buffer.  If 'fileformats' is empty,
  118.         the 'fileformat' of the current buffer is used.
  119.  
  120. :[N]new [+cmd] {file}
  121. :[N]sp[lit] [+cmd] {file}                *:split_f*
  122.         Create a new window and start editing file {file} in it.  If
  123.         [+cmd] is given, execute the command when the file has been
  124.         loaded |+cmd|.  Make new window N high (default is to use half
  125.         the existing height).  Reduces the current window height to
  126.         create room (and others, if the 'equalalways' option is set).
  127.  
  128. :[N]sv[iew] [+cmd] {file}            *:sv* *:sview* *splitview*
  129.         Same as ":split", but set 'readonly' option for this buffer.
  130.  
  131. CTRL-W CTRL-^                    *CTRL-W_CTRL-^* *CTRL-W_^*
  132. CTRL-W ^    Does ":split #", split window in two and edit alternate file.
  133.         When a count is given, it becomes ":split #N", split window
  134.         and edit buffer N.
  135.  
  136. Closing a window
  137. ----------------
  138.  
  139. CTRL-W q                        *CTRL-W_q*
  140. CTRL-W CTRL-Q                        *CTRL-W_CTRL-Q*
  141. :quit        Quit current window.  When quitting the last window (not
  142.         counting a help window), exit Vim.
  143.         When 'hidden' is set, and there is only one window for the
  144.         current buffer, it becomes hidden.
  145.         When 'hidden' is not set, and there is only one window for the
  146.         current buffer, and the buffer was changed, the command fails.
  147.         (Note: CTRL-Q does not work on all terminals)
  148.  
  149. :quit!        Quit current window.  If this was the last window for a buffer,
  150.         any changes to that buffer are lost.  When quitting the last
  151.         window (not counting help windows), exit Vim.  The contents of
  152.         the buffer are lost, even when 'hidden' is set.
  153.  
  154. CTRL-W c                    *CTRL-W_c* *:clo* *:close*
  155. :clo[se][!]    Close current window.  When the 'hidden' option is set, or
  156.         when the buffer was changed and the [!] is used, the buffer
  157.         becomes hidden (unless there is another window editing it).
  158.         This command fails when:
  159.         - There is only one window on the screen.
  160.         - When 'hidden' is not set, [!] is not used, the buffer has
  161.           changes, and there is no other window on this buffer.
  162.         Changes to the buffer are not written and won't get lost, so
  163.         this is a "safe" command.
  164.  
  165. CTRL-W CTRL-C                        *CTRL-W_CTRL-C*
  166.         You migh have expected that CTRL-W CTRL-C closes the current
  167.         window, but that does not work, because the CTRL-C cancels the
  168.         command.
  169.  
  170.                             *:hide*
  171. :hid[e]        Quit current window, unless it is the last window on the
  172.         screen.  The buffer becomes hidden (unless there is another
  173.         window editing it).
  174.         The value of 'hidden' is irrelevant for this command.
  175.         Changes to the buffer are not written and won't get lost, so
  176.         this is a "safe" command.
  177.  
  178. CTRL-W o                        *CTRL-W_o*
  179. CTRL-W CTRL-O                    *CTRL-W_CTRL-O* *:on* *:only*
  180. :on[ly]        Make the current window the only one on the screen.  All other
  181.         windows are closed.
  182.         When the 'hidden' option is set, all buffers in closed windows
  183.         become hidden.
  184.         When 'hidden is not set, and 'autowrite' option is set,
  185.         modified buffers are written  Otherwise, windows that have
  186.         buffers that are modified are not removed, unless the [!] is
  187.         given, then they become hidden.  But modified buffers are
  188.         never abandoned, so changes cannot get lost.
  189.  
  190. ==============================================================================
  191. 4. Moving cursor to other windows            *window-move-cursor*
  192.  
  193. CTRL-W <Down>                    *CTRL-W_<Down>*
  194. CTRL-W CTRL-J                    *CTRL-W_CTRL-J* *CTRL-W_j*
  195. CTRL-W j    move cursor to Nth window below current one.
  196.  
  197. CTRL-W <Up>                    *CTRL-W_<Up>*
  198. CTRL-W CTRL-K                    *CTRL-W_CTRL-K* *CTRL-W_k*
  199. CTRL-W k    move cursor to Nth window above current one.
  200.  
  201. CTRL-W w                    *CTRL-W_w* *CTRL-W_CTRL-W*
  202. CTRL-W CTRL-W    Without count: move cursor to window below current one.  If
  203.         there is no window below, go to top window.
  204.         With count: go to Nth window.
  205.  
  206.                         *CTRL-W_W*
  207. CTRL-W W    Without count: move cursor to window above current one.  If
  208.         there is no window above, go to bottom window.
  209.         With count: go to Nth window.
  210.  
  211. CTRL-W t                    *CTRL-W_t* *CTRL-W_CTRL-T*
  212. CTRL-W CTRL-T    move cursor to top window.
  213.  
  214. CTRL-W b                    *CTRL-W_b* *CTRL-W_CTRL-B*
  215. CTRL-W CTRL-B    move cursor to bottom window.
  216.  
  217. CTRL-W p                    *CTRL-W_p* *CTRL-W_CTRL-P*
  218. CTRL-W CTRL-P    go to previous (last accessed) window.
  219.  
  220. If Visual mode is active and the new window is not for the same buffer, the
  221. Visual mode is ended.
  222.  
  223. ==============================================================================
  224. 5. Moving windows around                *window-moving*
  225.  
  226. CTRL-W r                    *CTRL-W_r* *CTRL-W_CTRL-R*
  227. CTRL-W CTRL-R    Rotate windows downwards.  The first window becomes the second
  228.         one, the second one becomes the third one, etc.  The last
  229.         window becomes the first window.  The cursor remains in the
  230.         same window.
  231.  
  232.                         *CTRL-W_R*
  233. CTRL-W R    Rotate windows upwards.  The second window becomes the first
  234.         one, the third one becomes the second one, etc.  The first
  235.         window becomes the last window.  The cursor remains in the
  236.         same window.
  237.  
  238. CTRL-W x                    *CTRL-W_x* *CTRL-W_CTRL-X*
  239. CTRL-W CTRL-X    Without count: Exchange current window with next one.  If there
  240.         is no next window, exchange with previous window.
  241.         With count: Exchange current window with Nth window (first
  242.         window is 1).  The cursor is put in the other window.
  243.  
  244. ==============================================================================
  245. 6. Window resizing                    *window-resize*
  246.  
  247.                         *CTRL-W_=*
  248. CTRL-W =    make all windows (almost) equally high.
  249.  
  250. :res[ize] -N                    *:res* *:resize* *CTRL-W_-*
  251. CTRL-W -    decrease current window height by N
  252.  
  253. :resize +N                    *CTRL-W_+*
  254. CTRL-W +    increase current window height by N
  255.  
  256. :resize [N]
  257. CTRL-W CTRL-_                    *CTRL-W_CTRL-_* *CTRL-W__*
  258. CTRL-W _    set current window height to N (default: highest possible)
  259.  
  260. z<nr><CR>    set current window height to nr
  261.  
  262. You can also resize the window by dragging a status line up or down with the
  263. mouse.  This only works if the version of Vim that is being used supports the
  264. mouse and the 'mouse' option has been set to enable it.
  265.  
  266. The option 'winheight' ('wh') is used to set the minimal window height of the
  267. current window.  This option is used each time another window becomes the
  268. current window.  If the option is '0', it is disabled.  Set 'winheight' to a
  269. very large value, e.g., '9999', to make the current window always fill all
  270. available space.  Set it to a reasonable value, e.g., '10', to make editing in
  271. the current window comfortable.
  272.  
  273. When the option 'equalalways' ('ea') is set, all the windows are automatically
  274. made the same size after splitting or closing a window.  If you don't set this
  275. option, splitting a window will reduce the size of the current window and
  276. leave the other windows the same.  When closing a window, the extra lines are
  277. given to the window above it.
  278.  
  279. The option 'cmdheight' ('ch') is used to set the height of the command line.
  280. If you are annoyed by the |hit-return| prompt for long messages, set this
  281. option to 2 or 3.
  282.  
  283. If there is only one window, resizing that window will also change the command
  284. line height.  If there are several windows, resizing the current window will
  285. also change the height of the window below it (and sometimes the window above
  286. it).
  287.  
  288. ==============================================================================
  289. 7. Exiting Vim                        *window-exit*
  290.  
  291.                             *:qa* *:qall*
  292. :qa[ll]        Exit Vim, unless there are some buffers which have been
  293.         changed.  (Use ":bmod" to go to the next modified buffer).
  294.  
  295. :qall!        Exit Vim.  Any changes to buffers are lost.
  296.  
  297. :wqa[ll]                    *:wqa* *:wqall* *:xa* *:xall*
  298. :xa[ll]        Write all changed buffers and exit Vim.  If there are buffers
  299.         without a file name, which are readonly or which cannot be
  300.         written for another reason, Vim is not quit.
  301.  
  302. :wqall!
  303. :xall!        Write all changed buffers, even the ones that are readonly,
  304.         and exit Vim.  If there are buffers without a file name or
  305.         which cannot be written for another reason, Vim is not quit.
  306.  
  307. ==============================================================================
  308. 8. Writing with multiple buffers            *buffer-write*
  309.  
  310.                             *:wa* *:wall*
  311. :wa[ll]        Write all changed buffers.  Buffers without a file name or
  312.         which are readonly are not written.
  313.  
  314. :wa[ll]!    Write all changed buffers, even the ones that are readonly.
  315.         Buffers without a file name are not written.
  316.  
  317. ==============================================================================
  318. 9. argument and buffer list commands            *buffer-list*
  319.  
  320.       args list               buffer list       meaning ~
  321. 1. :[N]argument [N]    11. :[N]buffer [N]    to arg/buf N
  322. 2. :[N]next [file ..]    12. :[N]bnext [N]    to Nth next arg/buf
  323. 3. :[N]Next [N]        13. :[N]bNext [N]    to Nth previous arg/buf
  324. 4. :[N]previous    [N]    14. :[N]bprevious [N]    to Nth previous arg/buf
  325. 5. :rewind        15. :brewind        to first arg/buf
  326. 6. :last        16. :blast        to last arg/buf
  327. 7. :all            17. :ball        edit all args/buffers
  328.             18. :unhide        edit all loaded buffers
  329.             19. :[N]bmod [N]    to Nth modified buf
  330.  
  331.   split & args list       split & buffer list        meaning ~
  332. 21. :[N]sargument [N]   31. :[N]sbuffer [N]    split + to arg/buf N
  333. 22. :[N]snext [file ..] 32. :[N]sbnext [N]      split + to Nth next arg/buf
  334. 23. :[N]sNext [N]       33. :[N]sbNext [N]      split + to Nth previous arg/buf
  335. 24. :[N]sprevious [N]   34. :[N]sbprevious [N]  split + to Nth previous arg/buf
  336. 25. :srewind            35. :sbrewind           split + to first arg/buf
  337. 26. :slast              36. :sblast             split + to last arg/buf
  338. 27. :sall        37: :sball        edit all args/buffers
  339.             38. :sunhide        edit all loaded buffers
  340.                         39. :[N]sbmod [N]       split + to Nth modified buf
  341.  
  342. 40. :args        list of arguments
  343. 41. :buffers        list of buffers
  344.  
  345. The meaning of [N] depends on the command:
  346.  [N] is number of buffers to go forward/backward on ?2, ?3, and ?4
  347.  [N] is an argument number, defaulting to current argument, for 1 and 21
  348.  [N] is a buffer number, defaulting to current buffer, for 11 and 31
  349.  [N] is a count for 19 and 39
  350.  
  351. Note: ":next" is an exception, because it must accept a list of file names
  352. for compatibility with Vi.
  353.  
  354.  
  355. The argument list and multiple windows
  356. --------------------------------------
  357.  
  358. The current position in the argument list can be different for each window.
  359. Remember that when doing ":e file", the position in the argument list stays
  360. the same, but you are not editing the file at that position.  To indicate
  361. this, the file message (and the title, if you have one) shows
  362. "(file (N) of M)", where "(N)" is the current position in the file list, and
  363. "M" the number of files in the file list.
  364.  
  365. All the entries in the argument list are added to the buffer list.  Thus, you
  366. can also get to them with the buffer list commands, like ":bnext".
  367.  
  368. :[N]al[l][!] [N]                *:al* *:all* *:sal* *:sall*
  369. :[N]sal[l][!] [N]
  370.         Rearrange the screen to open one window for each argument.
  371.         All other windows are closed.  When a count is given, this is
  372.         the maximum number of windows to open.
  373.         When the 'hidden' option is set, all buffers in closed windows
  374.         become hidden.
  375.         When 'hidden is not set, and 'autowrite' option is set,
  376.         modified buffers are written  Otherwise, windows that have
  377.         buffers that are modified are not removed, unless the [!] is
  378.         given, then they become hidden.  But modified buffers are
  379.         never abandoned, so changes cannot get lost.
  380.         Buf/Win Enter/Leave autocommands are not executed for the new
  381.         windows here, that's only done when they are really entered.
  382.  
  383. :[N]sa[rgument][!] [N]                *:sa* *:sargument*
  384.         Short for ":split | argument [N]": split window and go to Nth
  385.         argument.  But when there is no such argument, the window is
  386.         not split.
  387.  
  388. :[N]sn[ext][!] [file ..]                *:sn* *:snext*
  389.         Short for ":split | [N]next": split window and go to Nth next
  390.         argument.  But when there is no next file, the window is not
  391.         split.
  392.  
  393. :[N]spr[evious][!] [N]                *:spr* *:sprevious*
  394. :[N]sN[ext][!] [N]                *:sN* *:sNext*
  395.         Short for ":split | [N]Next": split window and go to Nth
  396.         previous argument.  But when there is no previous file, the
  397.         window is not split.
  398.  
  399.                         *:sr* *:srewind*
  400. :sr[ewind][!]    Short for ":split | rewind": split window and go to first
  401.         argument.  But when there is no argument list, the window is
  402.         not split.
  403.  
  404.                         *:sla* *:slast*
  405. :sla[st][!]    Short for ":split | last": split window and go to last
  406.         argument.  But when there is no argument list, the window is
  407.         not split.
  408.  
  409. ==============================================================================
  410. 10. Tag or file name under the cursor            *window-tag*
  411.  
  412.                             *:sta* *:stag*
  413. :sta[g][!] [tagname]
  414.         Does ":tag[!] [tagname]" and splits the window for the found
  415.         tag.  See also |:tag|.
  416.  
  417. CTRL-W ]                    *CTRL-W_]* *CTRL-W_CTRL-]*
  418. CTRL-W CTRL-]    split current window in two.  Use identifier under cursor as a
  419.         tag and jump to it in the new upper window.  Make new window N
  420.         high.
  421.  
  422. CTRL-W f                    *CTRL-W_f* *CTRL-W_CTRL-F*
  423. CTRL-W CTRL-F    Split current window in two.  Edit file name under cursor.
  424.         Like ":split ]f", but window isn't split if the file does not
  425.         exist.
  426.         Uses the 'path' variable as a list of directory names where to
  427.         look for the file.  Also the path for current file is
  428.         used to search for the file name.
  429.         If the name is a hypertext link that looks like
  430.         "type://machine/path", only "/path" is used.
  431.         If a count is given, the count'th matching file is edited.
  432.         Not available when the |+file_in_path| feature was disabled at
  433.         compile time.
  434.  
  435. Also see |CTRL-W_CTRL-I|: open window for an included file that includes
  436. the keyword under the cursor.
  437.  
  438. ==============================================================================
  439. 11. Using hidden buffers                *buffer-hidden*
  440.  
  441. A hidden buffer is not displayed in a window, but is still loaded into memory.
  442. This makes it possible to jump from file to file, without the need to read or
  443. write the file every time and having to keep the file in a window.
  444.  
  445.                             *:buffer-!*
  446. If the option 'hidden' ('hid') is set, abandoned buffers are kept for all
  447. commands that start editing another file: ":edit", ":next", ":tag", etc.  The
  448. commands that move through the buffer list sometimes make the current buffer
  449. hidden although the 'hidden' option is not set.  This happens when a buffer is
  450. modified, but is forced (with '!') to be removed from a window, and
  451. 'autowrite' is off or the buffer can't be written.
  452.  
  453. You can make a hidden buffer not hidden by starting to edit it with any
  454. command.  Or by deleting it with the ":bdelete" command.
  455.  
  456.                             *hidden-quit*
  457. When you try to quit Vim while there is a hidden, modified buffer, you will
  458. get an error message and Vim will make that buffer the current buffer.  You
  459. can then decide to write this buffer (":wq") or quit without writing (":q!").
  460. Be careful: there may be more hidden, modified buffers!
  461.  
  462. :files                        *:files*
  463. :buffers                    *:buffers* *:ls*
  464. :ls        Show all buffers.  Example:
  465.  
  466. >            1 #h  "/test/text"        line 1
  467. >            2  -  "asdf"            line 0
  468. >            3 % + "version.c"        line 1
  469.  
  470.         Each buffer has a unique number.  That number will not change,
  471.         so you can always go to a specific buffer with ":buffer N" or
  472.         "N CTRL-^", where N is the buffer number.
  473.  
  474.          '-' indicates a buffer that is not loaded.  'h' indicates a
  475.         hidden buffer: It is loaded, but currently not displayed in a
  476.         window.  '%' indicates the buffer in the current window.  '#'
  477.         indicates the alternate buffer for ":e #" or CTRL-^.  '+'
  478.         indicates a modified buffer.
  479.  
  480. :[N]bd[elete]                    *:bd* *:bdel* *:bdelete*
  481. :bd[elete] [N]
  482.         Unload buffer [N] (default: current buffer) and delete it from
  483.         the buffer list.  If the buffer was changed, this fails.  The
  484.         file remains unaffected.  Any windows for this buffer are
  485.         closed.  If buffer [N] is the current buffer, the next buffer
  486.         (displayed in a window) becomes the current buffer.
  487.  
  488. :[N]bdelete!
  489. :bdelete! [N]
  490.         Unload buffer [N] (default: current buffer) and delete it from
  491.         the buffer list.  If the buffer was changed the changes are
  492.         lost.  The file remains unaffected.  Any windows for this
  493.         buffer are closed.  If buffer [N] is the current buffer, the
  494.         next buffer (displayed in a window) becomes the current
  495.         buffer.
  496.  
  497. :bdelete[!] {bufname}
  498.         Like ":bdelete[!] [N]", but buffer given by name.  Note that a
  499.         buffer whose name is a number cannot be referenced by that
  500.         name; use the buffer number instead.  Insert a backslash
  501.         before a space in a buffer name.
  502.  
  503. :N,Mbdelete[!]    do ":bdelete[!]" for all buffers in the range N to M
  504.         (inclusive).
  505.  
  506. :bdelete[!] N1 N2 ...
  507.         do ":bdelete[!]" for buffer N1, N2, etc.  The arguments can be
  508.         buffer numbers or buffer names (but not buffer names that are
  509.         a number).  Insert a backslash before a space in a buffer
  510.         name.
  511.  
  512. :[N]bun[load]                    *:bun* *:bunload*
  513. :bun[load] [N]
  514.         Unload buffer [N] (default: current buffer).  The memory
  515.         allocated for this buffer will be freed.  The buffer remains
  516.         in the buffer list.  If the buffer was changed, this fails.
  517.         Any windows for this buffer are closed.  If buffer [N] is the
  518.         current buffer, the next buffer (displayed in a window)
  519.         becomes the current buffer.
  520.  
  521. :[N]bunload!
  522. :bunload! [N]
  523.         Unload buffer [N] (default: current buffer).  The memory
  524.         allocated for this buffer will be freed.  The buffer remains
  525.         in the buffer list.  If the buffer was changed, the changes
  526.         are lost.  Any windows for this buffer are closed.  If buffer
  527.         [N] is the current buffer, the next buffer (displayed in a
  528.         window) becomes the current buffer.
  529.  
  530. :bunload[!] {bufname}
  531.         Like ":bunload[!] [N]", but buffer given by name.  Note that a
  532.         buffer whose name is a number cannot be referenced by that
  533.         name; use the buffer number instead.  Insert a backslash
  534.         before a space in a buffer name.
  535.  
  536. :N,Mbunload[!]    do ":bunload[!]" for all buffers in the range N to M
  537.         (inclusive).
  538.  
  539. :bunload[!] N1 N2 ...
  540.         do ":bunload[!]" for buffer N1, N2, etc.  The arguments can be
  541.         buffer numbers or buffer names (but not buffer names that are
  542.         a number).  Insert a backslash before a space in a buffer
  543.         name.
  544.  
  545. :[N]b[uffer][!] [N]                    *:b* *:buffer*
  546.         Edit buffer [N] from the buffer list.  If [N] is not given,
  547.         the current buffer remains being edited.  See |:buffer-!| for
  548.         [!].
  549.  
  550. :[N]b[uffer][!] {filename}
  551.         Edit buffer for {filename} from the buffer list.  See
  552.         |:buffer-!| for [!].
  553.  
  554. :[N]sb[uffer] [N]                    *:sb* *:sbuffer*
  555.         Split window and edit buffer [N] from the buffer list.  If [N]
  556.         is not given, the current buffer is edited.
  557.  
  558. :[N]sb[uffer] {filename}
  559.         Split window and edit buffer for {filename} from the buffer
  560.         list.
  561.  
  562.                             *:bn* *:bnext*
  563. :[N]bn[ext][!] [N]
  564.         Go to [N]th next buffer in buffer list.  [N] defaults to one.
  565.         Wraps around the end of the buffer list.  See |:buffer-!| for
  566.         [!].
  567.  
  568.                             *:sbn* *:sbnext*
  569. :[N]sbn[ext] [N]
  570.         Split window and go to [N]th next buffer in buffer list.
  571.         Wraps around the end of the buffer list.
  572.  
  573. :[N]bN[ext][!] [N]            *:bN* *:bNext* *:bp* *:bprevious*
  574. :[N]bp[revious][!] [N]
  575.         Go to [N]th previous buffer in buffer list.  [N] defaults to
  576.         one.  Wraps around the start of the buffer list.  See
  577.         |:buffer-!| for [!].
  578.  
  579. :[N]sbN[ext] [N]            *:sbN* *:sbNext* *:sbp* *:sbprevious*
  580. :[N]sbp[revious] [N]
  581.         Split window and go to [N]th previous buffer in buffer list.
  582.         Wraps around the start of the buffer list.
  583.  
  584.                             *:br* *:brewind*
  585. :br[ewind][!]    Go to first buffer in buffer list.  See |:buffer-!| for [!].
  586.  
  587.                             *:sbr* *:sbrewind*
  588. :sbr[ewind]    Split window and go to first buffer in buffer list
  589.  
  590.                             *:bl* *:blast*
  591. :bl[ast][!]    Go to last buffer in buffer list.  See |:buffer-!| for [!].
  592.  
  593.                             *:sbl* *:sblast*
  594. :sbl[ast]    Split window and go to last buffer in buffer list.
  595.  
  596. :[N]bm[odified][!] [N]                    *:bm* *:bmodified*
  597.         Go to [N]th next modified buffer in buffer list.
  598.  
  599. :[N]sbm[odified] [N]                    *:sbm* *:sbmodified*
  600.         Split window and go to [N]th next modified buffer in buffer
  601.         list.
  602.  
  603. :[N]unh[ide] [N]            *:unh* *:unhide* *:sun* *:sunhide*
  604. :[N]sun[hide] [N]
  605.         Rearrange the screen to open one window for each loaded buffer
  606.         in the buffer list.  When a count is given, this is the
  607.         maximum number of windows to open.
  608.  
  609. :[N]ba[ll] [N]                    *:ba* *:ball* *:sba* *:sball*
  610. :[N]sba[ll] [N]    Rearrange the screen to open one window for each buffer in
  611.         the buffer list.  When a count is given, this is the maximum
  612.         number of windows to open.  Buf/Win Enter/Leave autocommands
  613.         are not executed for the new windows here, that's only done
  614.         when they are really entered.
  615.  
  616. Note: All the commands above that start editing another buffer, keep the
  617. 'readonly' flag as it was.  This differs from the ":edit" command, which sets
  618. the 'readonly' flag each time the file is read.
  619.  
  620.  vim:ts=8:sw=8:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":
  621.